<template>
	<view class="all">
		<uni-nav-bar left-icon="back" title="浏览记录" @clickLeft="back()"></uni-nav-bar>
		<sun-tab :value.sync="index" @change="objectChange" :tabList="tabObjectList" rangeKey="name"></sun-tab>
		<view class="bott">今天 2021年3月20日 周二</view>
		<view class="demoList" v-for="(item,index) in tabObjectList" :key='index'>
			<view class="botteer" @click="login">
				<image class="box" src="../../static/imges/details1.png" mode=""></image>
				<view class="lian" >
					<view class="box4">泰禹云开壹品</view>
					<view class="box5">发布时间:2020-03-22 23:00</view>
					<view class="box6" style="margin-left: 10rpx;color: #027FC5;">雨花区·芙蓉中路雨花亭</view>
					<view class="butde">
						<text style="font-weight: 600;">￥4300</text><text class="box7">万元/月</text>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import sunTab from '@/components/sun-tab/sun-tab.vue'
	import uniNavBar from "../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue"
	import instance from "../../api/requset.js"
	export default {
		data() {
			return {
				index: 0,
				tabList: ['选项卡一', '选项卡三'], //普通数据赋值
				tabObjectList: [ //对象数组赋值
					{
						name: '商铺浏览',
						value: 1
					},
					{
						name: '楼盘浏览',
						value: 2
					}
				],
			}
		},
		components: {
			sunTab
		},
		onLoad(option) {
			console.log("用户id",option.id)
			var serverUrl = instance.serverUrl
			uni.request({
			    url: serverUrl + '/index.php/api/Member/room_collection', //仅为示例，并非真实接口地址。
			    data: {
					userid:option.id,
					lx:0
			    },
				header: { 'content-type': 'application/x-www-form-urlencoded', },
				method:'POST',
			    success: (res) => {
			        console.log(res.data.data.tant.data,"收藏")
			    }
			});
		},
		methods: {
			objectChange(){
				console.log(111)
			},
			back(){
				uni.navigateBack({
				    delta: 1
				});
			},
			login(){
				uni.navigateTo({
					url:'../Home/ShopsDetails'
				})
			}
		}
	}
</script>

<style>
	.bott {
		width: 100%;
		height: 60rpx;
		line-height: 60rpx;
		text-align: center;
		font-size: 16rpx;
		background-color: #F4F4F4;
		color: #ccc;
	}

	.box {
		width: 250rpx;
		height: 200rpx;
		border-radius: 20rpx;
	}

	.bue {
		width: 80rpx;
		height: 80rpx;
	}

	.botteer {
		display: flex;
		justify-content: space-between;
		margin: 30rpx 20rpx 0 20rpx;
		height: 230rpx;
		border-bottom: 1rpx solid #E7E7E7;
	}

	.box6,
	.box7 {
		font-size: 12rpx;
		margin-top: 20rpx;
	}

	.box5 {
		width: 400rpx;
		font-size: 26rpx;
		margin-top: 15rpx;
		color: #BCBCBC;
	}

	.butde {
		margin-top: 15rpx;
		color: #C92B29;
	}

	.lian {
		width: 330rpx;
		margin-right: 100rpx;
	}
</style>
